<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.saturn.auth.User"%>
<%@page import="com.saturn.sldb.Emergency"%>
<%@page import="com.saturn.app.utils.DateUtils"%>
<%@page import="com.saturn.auth.Organization"%>
<%@page import="java.util.*"%>
	<%
	User user = (User)session.getAttribute("authUser");
	String userId = user.getId();
	Organization organizationUser = Organization.getOneOrganizationByUser(userId);
	String name = organizationUser.getName();
	List organizations = Organization.getOrganizationByUser(user.getId());
	String department = "";
	if (organizations != null && !organizations.isEmpty()) {
		department = ((Organization)organizations.get(0)).getName();
	}
	%>	
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加紧急救助低保</title>
<%@ include file="/app/includes/header.jsp"%>
<style type="text/css">
<!--
.STYLE1 {
	font-size: 24px;
	font-weight: bold;
}
-->
	input {border:none;}
	.table_1{border-right:1px solid black; border-top:1px solid black}
	.table_1 td{border-left:1px solid black; border-bottom:1px solid black;}
	body{font-size:12px;}
</style>
<script> 
function submit(){ 
if(addForm.name.value==""){ 
alert("请输入姓名"); 
}else if(addForm.sex.value==""){ 
alert("请输入性别"); 
}else if(addForm.identify.value==""){ 
alert("请输入身份证号"); 
}else if(addForm.home.value==""){ 
alert("请输入家庭人口"); 
}else if(addForm.money.value==""){ 
alert("请输入审批金额"); 
}else if(addForm.people.value==""){ 
alert("请输入救助人口"); 
}else if(addForm.month.value==""){ 
alert("请输入救助月数"); 
}else if(addForm.home.value !=1 ){ 
		if($("input[name='peopleType']:checked").val() == "个人对象"){
		alert("家庭人口不为1请选择家庭对象！"); 
		}else{
			var identify = $("#identify").val(); //户主身份证号
			var identify0 = $("#c_identify0").val();//第一位家庭成员身份证号
			var identify1 = $("#c_identify1").val();//第二位家庭成员身份证号
			var identify2 = $("#c_identify2").val();//第三位家庭成员身份证号
			var identify3 = $("#c_identify3").val();//第四位家庭成员身份证号
			var identify4 = $("#c_identify4").val();//第五位家庭成员身份证号
			
			//*********家庭编号根据低保对象表中获取存储到数据库中*********BEGIN
			$.ajax({
				type : 'post',
				async : false,
				data : { "identify": identify},
				url : "<%=request.getContextPath()%>/app/sldb/emergency/apply/checkHomeNumberAction.action",
				success : function(data, textStatus, jqXHR){
					//console.info(data);
					if(data.homeNumber!=null){
						$("#homeNumber").val(data.homeNumber);
					}
				},
				dataType : 'json'
			});
			//*********家庭编号根据低保对象表中获取存储到数据库中*********END

			//*******************如不存在则返回“此申报信息为非低保户“信息字样******BEGIN
			var safeWay = $("input[name='safeWay']:checked").val();
			if(safeWay=="低保对象"){
				if(identify==""||identify==null){
					alert("身份证号不能为空");
					return;
				}
				/* start 判断户主和家庭成员身份证号是否为低保对象 */
				if(!identify ==""||!identify ==null){
					$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
							{ "identify": identify},
							function(data){
								if(data.count==0){
									alert("户主信息为非低保对象");
									return false;
								}else{
									if(!identify0==""||!identify0==null){
										$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
												{ "identify": identify0},
												function(data){
													if(data.count==0){ //返回0代表不是低保对象， 返回1代表是低保对象。
														 alert("第一位家庭成员信息为非低保对象");
														 return false;
													}else{
														if(!identify1 == ""||!identify1 == null){
															$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																	{ "identify": identify1},
																	function(data){
																		if(data.count==0){
																			alert("第二位家庭成员信息为非低保对象");
																			 return false;
																		}else{
																			if(!identify2 ==""||!identify2 ==null){
																				$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																						{ "identify": identify2},
																						function(data){
																							if(data.count==0){
																								alert("第三位家庭成员信息为非低保对象");
																								 return false;
																							}else{
																								if(!identify3 ==""||!identify3 ==null){
																									$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																											{ "identify": identify3},
																											function(data){
																												if(data.count==0){
																													alert("第四位家庭成员信息为非低保对象");
																													 return;
																												}else{
																													if(!identify4 ==""||!identify4 ==null){
																														$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																																{ "identify": identify4},
																																function(data){
																																	if(data.count==0){
																																		alert("第五位家庭成员信息为非低保对象");
																																		 return;
																																	}else{
																																		$('#addForm').submit();
																																	}		
																																}, 
																																"json");
																													}else{
																														$('#addForm').submit();
																													}
																												}		
																											}, 
																											"json");
																								}else{
																									$('#addForm').submit();
																								}
																							}		
																						}, 
																						"json");
																			}else{
																				$('#addForm').submit();
																			}
																		}		
																	}, 
																	"json");
														}else{
															$('#addForm').submit();
														}
													}	
												}, 
												"json");
									}else{
										$('#addForm').submit();
									}
								}		
							}, 
							"json");
				}
				/* end 判断户主和家庭成员身份证号是否为低保对象 */
			}else{
				$('#addForm').submit();
			}
		}
}else if(addForm.home.value ==1 ){
	if($("input[name='peopleType']:checked").val() == "家庭对象"){
		alert("家庭人口为1请选择个人对象！"); 
		}else{
			var identify = $("#identify").val();
			var identify0 = $("#c_identify0").val();//第一位家庭成员身份证号
			var identify1 = $("#c_identify1").val();//第二位家庭成员身份证号
			var identify2 = $("#c_identify2").val();//第三位家庭成员身份证号
			var identify3 = $("#c_identify3").val();//第四位家庭成员身份证号
			var identify4 = $("#c_identify4").val();//第五位家庭成员身份证号
			//*********家庭编号根据低保对象表中获取存储到数据库中*********BEGIN
			$.ajax({
				type : 'post',
				async : false,
				data : { "identify": identify},
				url : "<%=request.getContextPath()%>/app/sldb/emergency/apply/checkHomeNumberAction.action",
				success : function(data, textStatus, jqXHR){
					//console.info(data);
					if(data.homeNumber!=null){
						$("#homeNumber").val(data.homeNumber);
					}
				},
				dataType : 'json'
			});
			//*********家庭编号根据低保对象表中获取存储到数据库中*********END

			//*******************如不存在则返回“此申报信息为非低保户“信息字样******BEGIN
			var safeWay = $("input[name='safeWay']:checked").val();
			if(safeWay=="低保对象"){
				if(identify==""||identify==null){
					alert("身份证号不能为空");
					return;
				}
				/* start 判断户主和家庭成员身份证号是否为低保对象 */
				if(!identify ==""||!identify ==null){
					$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
							{ "identify": identify},
							function(data){
								if(data.count==0){
									alert("户主信息为非低保对象");
									return false;
								}else{
									if(!identify0==""||!identify0==null){
										$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
												{ "identify": identify0},
												function(data){
													if(data.count==0){ //返回0代表不是低保对象， 返回1代表是低保对象。
														 alert("第一位家庭成员信息为非低保对象");
														 return false;
													}else{
														if(!identify1 == ""||!identify1 == null){
															$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																	{ "identify": identify1},
																	function(data){
																		if(data.count==0){
																			alert("第二位家庭成员信息为非低保对象");
																			 return false;
																		}else{
																			if(!identify2 ==""||!identify2 ==null){
																				$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																						{ "identify": identify2},
																						function(data){
																							if(data.count==0){
																								alert("第三位家庭成员信息为非低保对象");
																								 return false;
																							}else{
																								if(!identify3 ==""||!identify3 ==null){
																									$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																											{ "identify": identify3},
																											function(data){
																												if(data.count==0){
																													alert("第四位家庭成员信息为非低保对象");
																													 return;
																												}else{
																													if(!identify4 ==""||!identify4 ==null){
																														$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																																{ "identify": identify4},
																																function(data){
																																	if(data.count==0){
																																		alert("第五位家庭成员信息为非低保对象");
																																		 return;
																																	}else{
																																		$('#addForm').submit();
																																	}		
																																}, 
																																"json");
																													}else{
																														$('#addForm').submit();
																													}
																												}		
																											}, 
																											"json");
																								}else{
																									$('#addForm').submit();
																								}
																							}		
																						}, 
																						"json");
																			}else{
																				$('#addForm').submit();
																			}
																		}		
																	}, 
																	"json");
														}else{
															$('#addForm').submit();
														}
													}	
												}, 
												"json");
									}else{
										$('#addForm').submit();
									}
								}		
							}, 
							"json");
				}
				/* end 判断户主和家庭成员身份证号是否为低保对象 */
			}else{
				$('#addForm').submit();
			}
		}
}else{
	var identify = $("#identify").val();
	var identify0 = $("#c_identify0").val();//第一位家庭成员身份证号
	var identify1 = $("#c_identify1").val();//第二位家庭成员身份证号
	var identify2 = $("#c_identify2").val();//第三位家庭成员身份证号
	var identify3 = $("#c_identify3").val();//第四位家庭成员身份证号
	var identify4 = $("#c_identify4").val();//第五位家庭成员身份证号
	//*********家庭编号根据低保对象表中获取存储到数据库中*********BEGIN
	$.ajax({
		type : 'post',
		async : false,
		data : { "identify": identify},
		url : "<%=request.getContextPath()%>/app/sldb/emergency/apply/checkHomeNumberAction.action",
		success : function(data, textStatus, jqXHR){
			//console.info(data);
			if(data.homeNumber!=null){
				$("#homeNumber").val(data.homeNumber);
			}
		},
		dataType : 'json'
	});
	//*********家庭编号根据低保对象表中获取存储到数据库中*********END

	//*******************如不存在则返回“此申报信息为非低保户“信息字样******BEGIN
	var safeWay = $("input[name='safeWay']:checked").val();
	if(safeWay=="低保对象"){
		if(identify==""||identify==null){
			alert("身份证号不能为空");
			return;
		}
		/* start 判断户主和家庭成员身份证号是否为低保对象 */
		if(!identify ==""||!identify ==null){
			$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
					{ "identify": identify},
					function(data){
						if(data.count==0){
							alert("户主信息为非低保对象");
							return false;
						}else{
							if(!identify0==""||!identify0==null){
								$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
										{ "identify": identify0},
										function(data){
											if(data.count==0){ //返回0代表不是低保对象， 返回1代表是低保对象。
												 alert("第一位家庭成员信息为非低保对象");
												 return false;
											}else{
												if(!identify1==""||!identify1==null){
													$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
															{ "identify": identify1},
															function(data){
																if(data.count==0){
																	alert("第二位家庭成员信息为非低保对象");
																	 return false;
																}else{
																	if(!identify2==""||!identify2==null){	
																	$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																				{ "identify": identify2},
																				function(data){
																					if(data.count==0){
																						alert("第三位家庭成员信息为非低保对象");
																						 return false;
																					}else{
																						if(!identify3==""||!identify3==null){	
																						$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																									{ "identify": identify3},
																									function(data){
																										if(data.count==0){
																											alert("第四位家庭成员信息为非低保对象");
																											 return;
																										}else{
																											if(!identify4==""||!identify4==null){	
																											$.post("<%=request.getContextPath()%>/app/sldb/emergency/apply/checkSafeWayAction.action",
																														{ "identify": identify4},
																														function(data){
																															if(data.count==0){
																																alert("第五位家庭成员信息为非低保对象");
																																 return;
																															}else{
																																$('#addForm').submit();
																															}		
																														}, 
																														"json");
																											
																										}else{
																											$('#addForm').submit();
																										}
																										}
																									}, 
																									"json");
																					}else{
																						$('#addForm').submit();
																					}
																					}
																				}, 
																				"json");
																	}else{
																		$('#addForm').submit();
																	}
																}
															}, 
															"json");
											}else{
												$('#addForm').submit();
											}
											}
										}, 
										"json");
						}else{
							$('#addForm').submit();
						}
						}
					}, 
					"json");
		}
		/* end 判断户主和家庭成员身份证号是否为低保对象 */
	}else{
		$('#addForm').submit();
	}
	//*******************如不存在则返回“此申报信息为非低保户“信息字样******END
	
	}
} 

//适用标准添加默认值
	$.ajax({
	    url:"<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.standard",
	    type:"post",
	    datatype:"json",
	    success:function(data){
	        $('#standard').combobox({ 
	            data:data.rows,
	            valueField:'id', 
	            textField:'text',
	            onLoadSuccess: function () { //加载完成后,设置选中第一项
	                var val = $(this).combobox("getData");
	                for (var item in val[0]) {
	                    if (item == "id") {
	                        $(this).combobox("select", val[0][item]);
	                    }
	                }
	            }
	        });        
	    }
	});
</script> 

<% 
	Calendar ca = Calendar.getInstance();
	int year = ca.get(Calendar.YEAR); //获取年份
	Emergency emergency = new Emergency();
	User user1 = (User)request.getSession().getAttribute("authUser");// TODO Auto-generated method stub
	String number = user1.getNumber();
	String id = user1.getId();
	number = number.substring(number.length()-4,number.length()-2);
	String numNO = "";
	String num1="";
	Emergency emergency1 = Emergency.getByCreater(id);
	if("".equals(emergency1) || emergency1 == null ){
		num1 = "001";
	}else{
		numNO = emergency1.getNumberNO();
		String numNOStr = numNO.substring(numNO.length()-3, numNO.length());
	    int a = Integer.valueOf(numNOStr);
	    int i = ++a;
	    int len = new Integer(a).toString().length();
	    switch (len) {
	    case 1:
	    	num1="00"+i;
	        break;
	    case 2:
	    	num1="0"+i;
	        break;
	    default:
	    	num1=i+"";
	        break;
	    }
	}
	
	String jnumberNO = "J"+ year + number + num1;
	for(int x=0;x<10;x++){
		if(jnumberNO.equals(Emergency.getByNumberNO(jnumberNO))){
			int jnumberNOInt = Integer.valueOf(jnumberNO)+1;
			jnumberNO = Integer.toString(jnumberNOInt);
		}else{
			continue;
		}
	}
	String ynumberNO = "Y"+ year + number + num1;
	for(int x=0;x<10;x++){
		if(ynumberNO.equals(Emergency.getByNumberNO(ynumberNO))){
			int ynumberNOInt = Integer.valueOf(ynumberNO)+1;
			ynumberNO = Integer.toString(ynumberNOInt);
		}else{
			continue;
		}
	}
%>
</head>
<body>
	<form id="addForm" name="addForm" action="<%=request.getContextPath()%>/app/sldb/emergency/apply/addEmergency.action" method="post">
		<input type="hidden" name="type1" value="noAuto" />
		<input id="createTime" name="createTime" type="hidden" value="<%=DateUtils.getSystemTime()%>"></input>
		<input id="creater" name="creater" type="hidden" value="<%=user.getId()%>"></input>
		<input id="createrName" name="createrName" type="hidden" value="<%=user.getName()%>"></input>
		<input id="createrDepartment" name="createrDepartment"  type="hidden" value="<%=department%>"></input>
		<input id="state" name="state" type="hidden" value="创建"></input>
		<input id="inputType" name="inputType" type="hidden" value="手动"></input>
		<input id="homeNumber" name="homeNumber" type="hidden" value=""></input>
		<input id="files" name="files" type="hidden" value=""></input>
		<input id="subject" name="subject" type="hidden" value=""></input>
		<!-- <input id="type" name="type" type="hidden" value="救助类别"></input> -->
		<input id="remarks" name="remarks" type="hidden" value="暂无数据"></input>
			
		<OBJECT classid="clsid:10946843-7507-44FE-ACE8-2B3483D179B7"
			id="CVR_IDCard" name="CVR_IDCard" width="0" height="0"> </OBJECT>

		<script language="javascript" type="text/javascript">
				function ClearForm() {
					document.getElementById('name').value = "";
                    document.getElementById('sex').value = "";
                    document.getElementById('identify').value =  "";
                    document.getElementById('address').value = "";
                    document.getElementById('picture').src = ""; 
                      ClearForm2();
                      return true;
				}
				function ClearForm2() {
					var i=0;
					for(;i<6;i++){
						document.getElementById('c_name'+i).value = "";
	                    document.getElementById('c_sex'+i).value = "";
	                    document.getElementById('c_identify'+i).value = "";
	                    document.getElementById('c_relation'+i).value = "";
	                    document.getElementById('c_marry'+i).value = "";
	                    document.getElementById('c_ill'+i).value = "";
	                    document.getElementById('c_disability'+i).value = "";
	                    document.getElementById('c_labor'+i).value = "";
					}
					
                      return true;
				}
				function Button1_onclick() {
                   	var CVR_IDCard = document.getElementById("CVR_IDCard");	
					var strReadResult = CVR_IDCard.ReadCard();
					if(strReadResult == "0")
					{
						ClearForm();
					    /* document.all['name'].value = CVR_IDCard.Name;  
                        document.all['sex'].value = CVR_IDCard.Sex;    
                        document.all['race'].value = CVR_IDCard.Nation; 
                        //document.all['Born'].value = CVR_IDCard.Born;  //出生日期    
                        document.all['address'].value = CVR_IDCard.Address; 
                        document.all['identify'].value = CVR_IDCard.CardNo;  */
                        document.getElementById('name').value =  CVR_IDCard.Name;
                        document.getElementById('sex').value =  CVR_IDCard.Sex;
                        document.getElementById('identify').value =  CVR_IDCard.CardNo;
                         document.getElementById('address').value = CVR_IDCard.Address;
                        document.getElementById('picture').src = "data:image/jpg;base64,"+CVR_IDCard.Picture;
                        document.getElementById('photo').value = CVR_IDCard.Picture;
                      /*   document.all['IssuedAt'].value = CVR_IDCard.IssuedAt; //签发机关
                        document.all['EffectedDate'].value = CVR_IDCard.EffectedDate;  //有效期限
                        document.all['ExpiredDate'].value = CVR_IDCard.ExpiredDate; //有效期限
                        document.all['SAMID'].value = CVR_IDCard.SAMID; //模块号码
                        //document.all['pic'].src = CVR_IDCard.Pic;
                        document.all['pic'].src = "data:image/jpg;base64,"+CVR_IDCard.Picture;
                        document.all['Picture'].value = CVR_IDCard.Picture; //照片编码
                        document.all['PictureLen'].value = CVR_IDCard.PictureLen; */ //编码长度
                      	//当前申请人员保障信息统计
                        window.open ('<%=request.getContextPath()%>/app/sldb/emergency/apply/statistics.jsp?cardNo='+CVR_IDCard.CardNo,'打印页面','height=300,width=300,top=50,left=300,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');
                   }else{
                        ClearForm();
                        alert(strReadResult);
                   }
				}
				function Button2_onclick() {
                   	var CVR_IDCard = document.getElementById("CVR_IDCard");					
					var strReadResult = CVR_IDCard.ReadCard();
					if(strReadResult == "0")
					{
						if(document.getElementById('c_identify0').value==""){
							document.getElementById('c_name0').value =  CVR_IDCard.Name;
	                        document.getElementById('c_sex0').value =  CVR_IDCard.Sex;
	                        document.getElementById('c_identify0').value =  CVR_IDCard.CardNo;
	                        document.getElementById('c_inputType0').value = "自动";
						}else if(document.getElementById('c_identify1').value==""){
							document.getElementById('c_name1').value =  CVR_IDCard.Name;
	                        document.getElementById('c_sex1').value =  CVR_IDCard.Sex;
	                        document.getElementById('c_identify1').value =  CVR_IDCard.CardNo;
	                        document.getElementById('c_inputType1').value = "自动";
						}else if(document.getElementById('c_identify2').value==""){
							document.getElementById('c_name2').value =  CVR_IDCard.Name;
	                        document.getElementById('c_sex2').value =  CVR_IDCard.Sex;
	                        document.getElementById('c_identify2').value =  CVR_IDCard.CardNo;
	                        document.getElementById('c_inputType2').value = "自动";
						}else if(document.getElementById('c_identify3').value==""){
							document.getElementById('c_name3').value =  CVR_IDCard.Name;
	                        document.getElementById('c_sex3').value =  CVR_IDCard.Sex;
	                        document.getElementById('c_identify3').value =  CVR_IDCard.CardNo;
	                        document.getElementById('c_inputType3').value = "自动";
						}else if(document.getElementById('c_identify4').value==""){
							document.getElementById('c_name4').value =  CVR_IDCard.Name;
	                        document.getElementById('c_sex4').value =  CVR_IDCard.Sex;
	                        document.getElementById('c_identify4').value =  CVR_IDCard.CardNo;
	                        document.getElementById('c_inputType4').value = "自动";
						}else if(document.getElementById('c_identify5').value==""){
							document.getElementById('c_name5').value =  CVR_IDCard.Name;
	                        document.getElementById('c_sex5').value =  CVR_IDCard.Sex;
	                        document.getElementById('c_identify5').value =  CVR_IDCard.CardNo;
	                        document.getElementById('c_inputType5').value = "自动";
						}
                        
                   }else{
                        alert(strReadResult);
                   }
				}
		</script>
		<!-- <a href="#" onclick="Button2_onclick()" class="easyui-linkbutton" id="Button1">分析</a> -->
		<a href="#" onclick="submit()" class="easyui-linkbutton" id="Button1">提   交</a>
		<a href="#" onclick="ClearForm()" class="easyui-linkbutton" id="Button2">清   空</a>
		<p>
<center>
<label style="font-size:24px">临时救助申请人基本情况登记表</label>
<br> 
<br>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_1">
  <tr>
      <td height="50" colspan="7" align="left">救助类别：
    	<input name="rescueCategory" type="radio" checked="checked" value="急难型"/>急难型&nbsp;
    	<input name="rescueCategory" type="radio" value="支出型"/> 支出型 &nbsp;
    	<input name="rescueCategory" type="radio" value="困境低保" />困境低保&nbsp;
    	<input name="rescueCategory" type="radio" value="其他" />其他<br>
    	紧急程度：&nbsp;<input name="type" id="ybjz" type="radio" checked="checked" value="一般救助"/>一般救助&nbsp;<input name="type" id="jjjz" type="radio" value="紧急救助"/>紧急救助<span style="float:right;margin:-20px 0px 0px 0px;">
    	编号： <input type="text" id="numberNO" name="numberNO" value="<%=ynumberNO %>" style="border-top-style:none;border-left-style:none;border-right-style:none;border-bottom-style:none;"/></span>
    	<input id="ynumberNO" type="hidden" value="<%=ynumberNO %>" />
    	<input id="jnumberNO" type="hidden" value="<%=jnumberNO %>" />
    </td>
  </tr>
  <tr>
    <td height="20" colspan="7" bgcolor="#BFBFBF"><strong>申请人基本情况：</strong></td>
    </tr>
  <tr>
    <td width="104" height="37"><div align="center">户主或本人姓名</div></td>
    <td width="116"><input id="name" type="text" name="name" size="9"/></td>
    <td width="111"><div align="center">性别</div></td>
    <td width="73"><input id="sex" type="text" name="sex" size="9"/></td>
    <td width="69"><div align="center">家庭人口</div></td>
    <td width="66"><input id="home" type="text" name="home" size="9" onkeyup="document.getElementById('people').value=this.value"/></td>
    <td rowspan="3"> &nbsp;&nbsp;&nbsp;上传照片</td>
    </tr>
  <tr>
    <td height="33"><div align="center">
      <p>公民身份证号</p>
      </div></td>
    <td colspan="5" align="left"><input id="identify" type="text" name="identify" size="18"/></td>
    </tr>
  
  <tr>
    <td height="50"><div align="center">对象类别</div></td>
    <td colspan="5" align="left">
      <span class="STYLE2"><input type="radio" id="geren" name="peopleType" checked="checked" value="个人对象" />个人对象&nbsp;&nbsp;<input type="radio" name="registration" checked="checked" value="本地户籍" />本地户籍&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="accountType" checked="checked" value="农村居民" />农村居民&nbsp;&nbsp;<input id="safeWay" type="radio" name="safeWay" checked="checked" value="低保对象" />低保对象</span><br>
      <span class="STYLE2"><input type="radio" id="jiating" name="peopleType" value="家庭对象" />家庭对象&nbsp;&nbsp;<input type="radio" name="registration" value="非本地户籍" />非本地户籍 &nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="accountType" value="城市居民" />城市居民&nbsp;&nbsp;<input type="radio" name="safeWay" value="非低保对象" />非低保对象</span></td>
    </tr>
  
  <tr>
    <td height="20" colspan="7" bgcolor="#BFBFBF" align="left"><strong>共同生活家庭成员情况：</strong></td>
    </tr>
  <tr>
    <td height="33"><div align="center">姓名</div></td>
    <td><div align="center">性别</div></td>
    <td><div align="center">与户主关系</div></td>
    <td colspan="3"><div align="center">公民身份证号</div></td>
    <td width="115"><div align="center">联系电话</div></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name0" type="text" name="c_name" size="8" /></td>
    <td><input id="c_sex0" type="text" name="c_sex" size="8"/></td>
    <td><span class="STYLE2"><select id="c_relation0" class="easyui-combobox"
		name="c_relation" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.relation" valueField="id"
		textField="text" editable="false" panelHeight="70"></select></span></td>
    <td colspan="3"><input id="c_identify0" type="text" name="c_identify" size="17"/></td>
    <td><input id="c_contact0" type="text" name="c_contact" size="11" /></td>
    <td ><input id="c_inputType0" type="hidden" name="c_inputType" value="手动"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name1" type="text" name="c_name" size="8" /></td>
    <td><input id="c_sex1" type="text" name="c_sex" size="8"/></td>
    <td><span class="STYLE2"><select id="c_relation1" class="easyui-combobox"
		name="c_relation" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.relation" valueField="id"
		textField="text" editable="false" panelHeight="70"></select></span></td>
    <td colspan="3"><input id="c_identify1" type="text" name="c_identify" size="17"/></td>
    <td><input id="c_contact1" type="text" name="c_contact" size="11" /></td>
    <td ><input id="c_inputType1" type="hidden" name="c_inputType" value="手动"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name2" type="text" name="c_name" size="8" /></td>
    <td><input id="c_sex2" type="text" name="c_sex" size="8"/></td>
    <td><span class="STYLE2"><select id="c_relation2" class="easyui-combobox"
		name="c_relation" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.relation" valueField="id"
		textField="text" editable="false" panelHeight="70"></select></span></td>
    <td colspan="3"><input id="c_identify2" type="text" name="c_identify" size="17"/></td>
    <td><input id="c_contact2" type="text" name="c_contact" size="11" /></td>
    <td ><input id="c_inputType2" type="hidden" name="c_inputType" value="手动"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name3" type="text" name="c_name" size="8" /></td>
    <td><input id="c_sex3" type="text" name="c_sex" size="8"/></td>
    <td><span class="STYLE2"><select id="c_relation3" class="easyui-combobox"
		name="c_relation" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.relation" valueField="id"
		textField="text" editable="false" panelHeight="70"></select></span></td>
    <td colspan="3"><input id="c_identify3" type="text" name="c_identify" size="17"/></td>
    <td><input id="c_contact3" type="text" name="c_contact" size="11" /></td>
    <td ><input id="c_inputType3" type="hidden" name="c_inputType" value="手动"/></td>
  </tr>
  <tr>
    <td height="20"><input id="c_name4" type="text" name="c_name" size="8" /></td>
    <td><input id="c_sex4" type="text" name="c_sex" size="8"/></td>
    <td><span class="STYLE2"><select id="c_relation4" class="easyui-combobox"
		name="c_relation" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.relation" valueField="id"
		textField="text" editable="false" panelHeight="70"></select></span></td>
    <td colspan="3"><input id="c_identify4" type="text" name="c_identify" size="17"/></td>
    <td><input id="c_contact4" type="text" name="c_contact" size="11" /></td>
    <td ><input id="c_inputType4" type="hidden" name="c_inputType" value="手动"/></td>
  </tr>
  <tr>
    <td height="28"><div align="center">审批人</div></td>
    <td colspan="2" align="left"><input id="audit" type="text" name="audit" size="11" /></td>
    <td colspan="3"><div align="center">审批金额</div></td>
    <td align="left"><input id="money" type="text" name="money" size="11" readonly="readonly"/></td>
  </tr>
  <tr>
    <td height="55"><div align="center">申请事由</div></td>
    <td height="55" colspan="6" align="left"><span class="STYLE2"><input type="radio" name="applyCause" checked="checked" value="火灾" />火灾&nbsp;<input type="radio" name="applyCause" value="交通事故" />交通事故&nbsp;<input type="radio" name="applyCause"  value="突发重大疾病" />突发重大疾病<input type="radio" name="applyCause" value="困境低保" />困境低保&nbsp;<input type="radio" name="applyCause" value="支出型困难" />支出型困难&nbsp;<input type="radio" name="applyCause" value="其他特殊困难" />其他特殊困难</span><br><br>&nbsp;病种描述：<input type="text" name="causeDesc" id="causeDesc" size="60" style="border-bottom: 1px solid;"/></td>
  </tr>
  <tr>
    <td height="20" colspan="7" bgcolor="#CCCCCC" align="left"><strong>审批情况：<span style="float:right;margin-right:20px;"><input name="approveType" type="radio" value="审批建议"/>审批建议&nbsp;<input name="approveType" type="radio"  checked="checked" value="小额审批"/>小额审批</span></strong></td>
    </tr>
  
  <tr>
    <td height="34"><div align="center">救助标准</div></td>
    <td height="34" colspan="6" align="left">救助人口：<input id="people" type="text" name="people" size="8" style="border-bottom: 1px solid;" readonly="readonly"/>人 
    	<p> 救助月数：
    	 <select id="month" class="easyui-combobox" name="month" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.month" valueField="id" textField="text" editable="false" panelHeight="150"></select>月  
    	适用低保标准：
    	<select id="standard" class="easyui-combobox" name="standard" url="<%=request.getContextPath()%>/app/system/dict/listDictByType.action?type=sldb.standard" valueField="id" textField="text" editable="false" panelHeight="30"></select>元/月
    </td>
  </tr>
  <tr>
    <td height="29"><div align="center">救助方式</div></td>
    <td height="29" colspan="6" align="left"><span class="STYLE2"><input type="radio" name="way"value="社会化发放" />社会化发放&nbsp;<input type="radio" name="way" checked="checked"  value="发放现金" />发放现金</span></td>
  </tr>
  <tr>
    <td height="20" colspan="7" bgcolor="#BFBFBF" align="left"><strong>附件：</strong></td>
    </tr>
  <tr>
    <td height="99" colspan="7" align="left">&nbsp;&nbsp;&nbsp;&nbsp;暂无附件</td>
    </tr>
</table>
</center>
<input type="hidden" id="photo" name="photo" value="1"/>
</form>
 <script type="text/javascript">
	$(document).ready(function() {
		
		 //*******************审批金额的值自动获取救助标准的月数*人数*金额的积***********************BEGIN
		/* $("#standard").combobox({
			onSelect : function(){
				var standard = $('#standard').combobox('getText');
				var month = $('#month').combobox('getText');
				var people = $("#people").val();
				if(people==""||people==null){
					alert("请输入救助人口");
				}
				if(month==""||month==null){
					alert("请输入救助月数");
				}
				if(standard==""||standard==null){
					alert("请输入适用低保标准");
					return;
				}
				$("#money").val(people*month*standard);
			}
		}); */
		$("#month").combobox({
			onSelect : function(){
				var standard = $('#standard').combobox('getText');
				var month = $('#month').combobox('getText');
				var people = $("#people").val();
				if(people==""||people==null){
					alert("请输入救助人口");
				}
				if(month==""||month==null){
					alert("请输入救助月数");
				}
				if(standard==""||standard==null){
					alert("请输入适用低保标准");
					return;
				}
				$("#money").val(people*month*standard);
			}
		});
		$("#home").keyup(function(){
			var standard = $('#standard').combobox('getText');
			var month = $('#month').combobox('getText');
			var people = $("#people").val();
			if(people==""||people==null){
				alert("请输入救助人口");
			}
			if(month==""||month==null){
				alert("请输入救助月数");
			}
			if(standard==""||standard==null){
				alert("请输入适用低保标准");
				return;
			}
			$("#money").val(people*month*standard);
		});
		//*******************审批金额的值自动获取救助标准的月数*人数*金额的积***********************END
		
		//*******************救助类型选择一般救助  编号的第一位编码为Y，选择紧急救助 编号的第一位编码为J******BEGIN
		$("#ybjz").click(function(){
			var ynumberNO = $("#ynumberNO").val();
			$("#numberNO").val(ynumberNO);
		});
		$("#jjjz").click(function(){
			var jnumberNO = $("#jnumberNO").val();
			$("#numberNO").val(jnumberNO);
		});
		//*******************救助类型选择一般救助  编号的第一位编码为Y，选择紧急救助 编号的第一位编码为J******END
		
		//*******************模态窗口形式统计当前低保户本年的申报次数、总金额、年份、姓名、身份证号信息******BEGIN
		$("#identify").blur(function(){
			var identify = $("#identify").val();
			var length = identify.length;
			if(length!=18 && length!=15){
				alert("身份证号位数为15位或18位！");
				return;
			}
			if(identify==""||identify==null){
				alert("身份证号不能为空");
				return;
			}
			//当前申请人员保障信息统计
            window.open ('<%=request.getContextPath()%>/app/sldb/emergency/apply/statistics.jsp?cardNo='+identify,'打印页面','height=300,width=900,top=50,left=300,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');
		});
	});
		//*******************模态窗口形式统计当前低保户本年的申报次数、总金额、年份、姓名、身份证号信息******END
</script>
</body>
</html>
